home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Gold Collection / Software Vault - The Gold Collection (American Databankers) (1993).ISO / cdr49 / 134_01.zip / DIFF.NRO < prev    next >
Text File  |  1993-06-12  |  4KB  |  118 lines

  1. .so AN.NRO
  2. .TH DIFF 1 "File comparator
  3. .SH NAME
  4. diff -- File comparator
  5. .SH SYNOPSIS
  6. .bo
  7. diff <file1> <file2> <options>
  8. .sp
  9. Options:
  10. .sp
  11. -Alterations | -Match
  12. .br
  13. -Resynch <n>
  14. .br
  15. -Header "foo"
  16. .br
  17. -Blanks
  18. .br
  19. -Singlecase
  20. .br
  21. -Zdebug
  22. .SH DESCRIPTION
  23. .PP
  24. Diff performs a comparison between two ASCII files, and lists the differences
  25. on the console or to redirected output.  The general form of a difference
  26. listing is:
  27. .sp
  28. .nf
  29. .nj
  30. --------------------------------------- <line1>
  31. some lines from the first file
  32. --------------------------------------- <line2>
  33. the corresponding lines from the
  34. second file
  35. .fi
  36. .ju
  37. .PP
  38. Several options are available for changing the way DIFF operates.  They are
  39. listed below.
  40. .PP
  41. -Match specifies that, rather than listing the differences as shown above,
  42. lines that are the same in both files are to be listed.  The header
  43. line will specify the line numbers in file1 and file2, separated by
  44. a comma.
  45. .PP
  46. -Alters specifies that the changed lines in file2 are to be listed.  The
  47. format of the listing is:
  48. .sp
  49. .nf
  50. .nj
  51. --------------------------------- <line1>
  52. some lines inserted in second file
  53. --------------------------------- <line2>, <line3>
  54. some lines in second file replacing
  55. lines from the first file.
  56. .fi
  57. .ju
  58. .sp
  59. The first header indicates that the lines which follow are inserted before
  60. line #<line1> in the first file; the second shows that the following lines
  61. replace <line2> through <line3> in the first file.
  62. .PP
  63. -Resynch <n> specifies that at least <n> matching lines are required for
  64. DIFF to end a set of differing lines.  The default is 3.
  65. .PP
  66. -Header "foo" says that "foo" is the string to print at the beginning of
  67. a header line.  The default is a string of dashes.
  68. .PP
  69. -Blank causes DIFF to treat all strings of blanks and tabs as if they
  70. were single blanks, and to ignore trailing blanks and tabs on lines.
  71. It is useful if two files have things aligned in different columns, but
  72. are otherwise similar.
  73. .PP
  74. -Singlecase causes DIFF to treat lowercase characters the same as their
  75. uppercase equivalents.  By default, DIFF respects case differences.
  76. .PP
  77. -Zdebug is used to debug DIFF; it causes a trace of the resynchronization
  78. loop to be printed.  It isn't particularly useful.
  79. .PP
  80. Any option may be abbreviated to its first character.
  81. .SH EXAMPLES
  82. .nf
  83. .nj
  84. diff whosis.bak whosis.c
  85. diff -match myfile herfile >duplines
  86. diff oldfile newfile -single -resync 4 
  87. .fi
  88. .ju
  89. .SH DIAGNOSTICS
  90. .PP
  91. "Unknown option" -- An unrecognizable option appears on the command line.
  92. .PP
  93. "-xxx option requires a value" -- The -Resync or -Header option was
  94. specified without giving a value.
  95. .PP
  96. "Files have too many differences to compare." -- The two files had
  97. so many contiguous lines without a match that DIFF ran out of memory.
  98. .PP
  99. "can't happen" -- DIFF detected an internal error condition.  This
  100. message should never appear.
  101. .SH BUGS
  102. .PP
  103. Sometimes, DIFF loses its place in the files, and starts reporting some
  104. outrageous group of differences or runs out of memory.  If this happens,
  105. the file generally has some group of three or more consecutive lines
  106. that are identical but appear in the middle of a changed area.  If so,
  107. a larger value of "-resync" may help.
  108. .PP
  109. Equal lines in the middle of a region of differences are reported as different.
  110. If the comparison doesn't break down, a smaller value of "-resync" may
  111. edit these out.
  112. .SH NOTES
  113. If the files have a large number of differences, DIFF may take quite
  114. a while, apparently without disc activity, to find its place.  If you
  115. are expecting a large number of differences, don't worry; this is
  116. normal.  If you aren't expecting many differences, make sure that
  117. you're comparing the correct pair of files.
  118. so many contiguous lines without a match